<?php

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty price_format modifier plugin
 *
 * Type: modifier<br>
 * Name: price_format<br>
 * Purpose: format price
 *
 * @param string     $price      Price
 * @param character  $currency   USD, GBP, BGN, EUR, AUD, CAD
 *
 * @return string    Formatted price
 */

function smarty_modifier_price_format($price, $currency = 'USD')
{ 
	switch ($currency) {
  	case 'AUD':
    	$price = '$'.$price.' ('.$currency.')';
    	break;
    case 'CAD':
    	$price = '$'.$price.' ('.$currency.')';
    	break;
    case 'BGN':
    	$price = $price.' ('.$currency.')';
    	break;
    case 'EUR':
    	$price = '&euro;'.$price.' ('.$currency.')';
    	break;
    case 'GBP':
    	$price = '&pound;'.$price.' ('.$currency.')';
    	break;
    default: // USD
    	$price = '$'.$price.' ('.$currency.')';
    	break;
  
  }
  
  return $price;
} 
/* vim: set expandtab: */

?>